import request from '@/utils/request'
//主表查询
export function fetchList(params) {
  return request({
    url: '/worklog/list',
    method: 'get',
    params: params
  })
}

//子表查询
export function fetchLists(params) {
  return request({
    url: '/log/list',
    method: 'get',
    params: params
  })
}
//根据id查询
export function getLogById(id) {
  return request({
    url:'/worklog/getById/'+id,
    method:'get',
  })
}

//添加一
export function tbworkAdd(entity) {
  return request({
    url: '/worklog/add',
    method: 'post',
    data: entity
  })
}


//嵌套添加
export function createWorklog(entity) {
  return request({
    url: '/worklog/edit',
    method: 'post',
    data: entity
  })
}

//修改
export function updateLog(data) {
  return request({
    url: '/worklog/update',
    method: 'post',
    data: data
  })
}

export function selectByGroupId(id) {
  return request({
    url: '/worklog/getById/' + id,
    method: 'get',
  })
}
//单删
export function deleteLog(id) {
  return request({
    url: '/worklog/delete/?id=' + id,
    method: 'get',
  })
}
//批量删除GET
export function deleteLogBatch(ids) {
  return request({
    url: '/worklog/deleteBatch',
    method: 'get',
    params: ids
  })
}












//子表查询
export function getAllId(param) {
  return request({
    url: '/sysDetail/getAllId',
    method: 'get',
    params: param
  })
}


//子表单删
export function deleteDetail(id) {
  return request({
    url: '/sysDetail/delete/?id=' + id,
    method: 'get',
  })
}

//子表添加
export function addLog(entity) {
  return request({
    url: '/sysDetail/add',
    method: 'post',
    data: entity
  })
}

//子表修改
export function updateDetail(data) {
  return request({
    url: '/sysDetail/update',
    method: 'post',
    data: data
  })
}
